Skip to content

docs: clarify baggage current context behavior - #5397

Closed
goutamadwant wants to merge 1 commit into
open-telemetry:mainfrom
goutamadwant:docs-baggage-current-context
Closed

docs: clarify baggage current context behavior#5397
goutamadwant wants to merge 1 commit into
open-telemetry:mainfrom
goutamadwant:docs-baggage-current-context

Conversation

@goutamadwant

Copy link
Copy Markdown

Description

Clarifies that baggage helpers return updated Context values and do not attach those values as the current context automatically.

The docs now show the difference between reading baggage from an explicit context and reading baggage from the current context. They also include the context.attach / context.detach pattern needed when callers want a returned context to become current.

Fixes #2432

Type of change

  • This change requires a documentation update

How Has This Been Tested?

  • uv run tox -e docs
  • Ran the documented baggage/context snippets locally

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests are not applicable for this documentation-only change
  • Documentation has been updated

@goutamadwant
goutamadwant requested a review from a team as a code owner July 7, 2026 00:53
Comment thread docs/api/context.rst
finally:
context.detach(token)

This is the same model used by :mod:`opentelemetry.baggage`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's the other way around: baggage follows what is expected to do by the Context API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. no need to mention Baggage here.

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Jul 25, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

This PR has been closed due to inactivity. Please reopen if you would like to continue working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Current context is empty with baggage.get_all

2 participants